//
//
//
//
//
//
// StrStream.h
//



#ifndef _STR_STREAM_H_
#define _STR_STREAM_H_


#include "common.h"
#include <string>

namespace Util
{
	class StrStream
	{
		public:
			StrStream();
			StrStream(const char* msg);
			StrStream(U32 size);
			~StrStream();

			StrStream& operator<< (U8);
			StrStream& operator<< (U16);
			StrStream& operator<< (U32);
			StrStream& operator<< (S32);

			StrStream& operator<< (const std::string&);
			StrStream& operator<< (const char*);
			
			operator std::string() const;
			operator const char* () const;

			std::string AsString(void) const;
			const char* Str(void) const;
		private:
			void NeedEnlg(U32 num);

		private:
			char* _buf;

			// include the final null indicator
			U32 _size;
			U32 _capability;
	};
};

#endif // _STR_STREAM_H_
